package com.xiaodu.acer.phoneplay.data;

import com.xiaodu.acer.phoneplay.bean.LoginBean;
import com.xiaodu.acer.phoneplay.bean.requestbean.LoginRequestBean;
import com.xiaodu.acer.phoneplay.data.http.ApiService;
import com.xiaodu.acer.phoneplay.presenter.contract.LoginContract;

import javax.inject.Inject;

import io.reactivex.Observable;
import library.base.BaseBean;

/**
 * @author 小杜
 *         邮箱:m15701207383@163.com
 * @version V1.0
 * @Description: ${TODO}(用一句话描述该文件做什么)
 * @date 2018/1/10 13:35
 */

public class LoginModel implements LoginContract.Model {

    private ApiService mApiService;

    public LoginModel(ApiService service) {
        this.mApiService = service;
    }


    @Override
    public Observable<BaseBean<LoginBean>> getLogin(String phone, String pwd) {
        LoginRequestBean bean = new LoginRequestBean();
        bean.setEmail(phone);
        bean.setPassword(pwd);

        return mApiService.login(bean);
    }
}
